package com.hxkj.domain.enums;

import com.platform.common.domain.exception.CustomExceptionCode;

public enum DictItemExceptionEnum implements CustomExceptionCode {

    DICTITEM_NOT_ID(605,"字典id为空",900),
    DICTITEM_NOT_NAME(606,"字典名称为空",900),
    DICTITEM_NOT_MSG(607,"字典不存在",900),
    MODIFLY_DICTITEM_ERROR(608,"该字典已存在",900),
    DICTITEM_GET_ERROR(609,"查询一级字典错误",900),
    DICTITEM_NAME_ERROR(610,"字典名称或编号重复",900),
    DICTITEM_MODIFY_ERROR(611,"修改一级字典错误",900),
    DICTITEM_DEL_ERROR(612,"一级字典下还有二级字典，不能删除",900),
    DICTITEM_DELETE_ERROR(613,"一级字典删除错误",900),
    DICTITEM_SAVE_ERROR(614,"新增一级字典错误",900),
    DICTTYPE_GET_ERROR(615,"查询二级字典错误",900),
    DICTTYP_NAME_ERROR(616,"二级字典名称重复 或者 Code 重复 ",900),
    DICTTYP_MODIFY_ERROR(617,"修改二级字典错误",900),
    DICTTYP_DELETE_ERROR(618,"二级字典删除错误",900),
    DICTTYP_SAVE_ERROR(619,"新增二级字典错误",900),
    DICTTYP_ITEMVALUE_NULL(620,"字典code为空",900),
    DICTTYP_DEL_TAG_NULL(621,"禁用标识为空",900),
    DICTITEM_DEL_TAG_ERROR(622,"一级字典下还有二级字典，不能禁用",900),
    DICTTYP_DEL_DAG_ERROR(623,"一级字典禁用错误",900),
    DICTTYP_COMBOX_ERROR(624,"二级字典下拉框错误",900),



    ;


    private Integer code;

    DictItemExceptionEnum(Integer code, String msg, Integer httpCode) {
        this.code = code;
        this.msg = msg;
        this.httpCode = httpCode;
    }

    private String msg;
    private Integer httpCode;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public Integer getHttpCode() {
        return httpCode;
    }

    public static DictItemExceptionEnum getEnumByCode(Integer code) {
        DictItemExceptionEnum[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            DictItemExceptionEnum dictItemExceptionEnum = var1[var3];
            if (code.equals(dictItemExceptionEnum.getCode())) {
                return dictItemExceptionEnum;
            }
        }

        return null;
    }

    @Override
    public void setHttpCode(Integer httpCode) {
        this.httpCode = httpCode;
    }
}
